package com.example.villagemarket.adapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.example.villagemarket.MainActivity;
import com.example.villagemarket.R;

import com.example.villagemarket.R.layout;


import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.ListView;

public class MenuListView extends Activity {

	static final String ITEM_ID = "id";
	static final String ITEM_DESCRIPTION = "description";
	static final String ITEM_NAME = "name";

	

	ResultsAdapter adapter;

	ArrayList<HashMap<String, String>> itemsList;
	


	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_search_fragment);
		


	}

	public ArrayList<HashMap<String, String>> populateListView(
			List<Map<String, String>> results, ListView list) {
		itemsList = new ArrayList<HashMap<String, String>>();

		for (int i = 0; i < results.size(); i++) {

			HashMap<String, String> map = new HashMap<String, String>();

			String temp = results.get(i).get("item");

			String[] tempArray;
			tempArray = temp.split(":");

			map.put(ITEM_ID, i + "");
			map.put(ITEM_DESCRIPTION, tempArray[0]);
			map.put(ITEM_NAME,tempArray[1]);
			
			
					

			itemsList.add(map);
				
			}
			

			

		return itemsList;

	}
	
	


}